{include file="../app/common/admin/lib/header.html" title="角色管理"}
  <div class="page-header border-bottom clearfix">
    <h2 class="left">角色管理<span>在这里对角色进行管理</span></h2>
    <a href="{:url('role/admin/add')}" class="btn btn-success btn-sm right">添加角色</a>
  </div>
  <!--start:列表-->
  <table class="list-table">
    <caption>按状态：
      <a href='{:url("role/admin/index",["status"=>1])}' {if $status == 1} class="label label-primary" {else} class="label label-default" {/if}>正常</a>
      <a href='{:url("role/admin/index",["status"=>0])}' {if $status == 0} class="label label-primary" {else} class="label label-default" {/if}>已删除</a>
    </caption>
    <thead><tr>
      <th style="width:20px;"><input type="checkbox" class="selectAll"></th>
      <th>角色名</th>
      <!-- 
      <th>成员</th>
       -->
      <th>添加时间</th>
      <th>操作</th>
    </tr></thead>
    <tbody>
      {if $list}
        {foreach $list['data'] as $k=>$v}
          <tr id="dataList{$v.id}" {if $k%2 == 1} class="bg-gray"{/if} data-id="{$v.id}">
            <td><input type="checkbox" class="listSelect"></td>
            <td>{$v.title}</td>
            <!-- <td>--</td> -->
            
            <td>{$v.add_time|time_format}</td>
            <td>
              {if $status == 1}
                {/*if $v.id != 1*/}
                <a href='{:url("role/admin/edit",["id"=>$v.id])}' class="btn btn-success btn-xs"><i class="icon-trash icon-white"></i>编辑或查看权限</a>
                <!-- <a href="{AnUrl("role/controller/add_user?id={$v.id}")}" class="btn btn-success btn-xs"><i class="icon-trash icon-white"></i>成员添加</a> -->
                <a href='{:url("role/admin/delete",["id"=>$v.id])}' class="btn btn-danger btn-xs deleteOne"><i class="icon-trash icon-white"></i>删除</a>
                {/*/if*/}
              {else}
                <a href='{:url("role/admin/change_status",["id"=>$v.id])}' class="btn btn-success btn-xs changeStatus"><i class="icon-trash icon-white"></i>恢复</a>
              {/if}
            </td>
          </tr>
        {/foreach}
      {else}
        <tr><td class="txtleft" colspan="9">暂无数据</td></tr>
      {/if}
    </tbody>
  </table>

<div id="pages"></div>

<!--end:列表-->
<script>
$(function(){
  // 高级搜索
  $('.js_advanced').click(function(e){
    e.preventDefault();
    var thisObj = $(this);
    var outBox  = thisObj.closest('form');
    if (thisObj.hasClass('js_isOpen')) {
      thisObj.removeClass('js_isOpen open');
      outBox.find('input').show();
      outBox.find('button').show();
      $('.js_advancedForm').hide();
    } else {
      thisObj.addClass('js_isOpen open');
      outBox.find('input').hide();
      outBox.find('button').hide();
      $('.js_advancedForm').show();
    }
  });
});
</script>
{include file="../app/common/admin/lib/footer.html"}